<?php

namespace Plugins\AdminBasic\Requests;

use App\Requests\AbstractRequest;
use Hyperf\Validation\Rule;


/**
 * 管理员角色验证器
 */
class BasicRoleRequest extends AbstractRequest
{


    public function allRules(): array
    {
        return [
            'id' => ['required'],
            'name' => ['required'],
            'creator_belongs_to' => ['required'],
            'creator_id' => ['required'],
            'describe' => ['required'],
            'route_ids' => ['required']
        ];
    }

    public function attributes(): array
    {
        return [
            'id' => 'ID',
            'name' => '角色',
            'creator_belongs_to' => '创建者属于那个表',
            'creator_id' => '创建者ID',
            'describe' => '描述',
            'route_ids' => '权限路由ID集合'
        ];
    }

    public function updateScene(): array
    {
        return ["id", "name"];
    }

    public function storeScene(): array
    {
        return ['name'];
    }

    public function destroyScene(): array
    {
        return [
            'data' => 'array'
        ];
    }
}